using System;

namespace Scenes.Msg
{
    public class LoadSceneMsg
    {
        public int SceneBuildIndex;
        public string SceneBuildName;
        public Action OnSceneLoaded;

        public LoadSceneMsg(int sceneBuildIndex)
        {
            SceneBuildIndex = sceneBuildIndex;
        }

        public LoadSceneMsg(int sceneBuildIndex, Action onSceneLoaded)
        {
            SceneBuildIndex = sceneBuildIndex;
            OnSceneLoaded = onSceneLoaded;
        }

        public LoadSceneMsg(string sceneBuildName, Action onSceneLoaded)
        {
            SceneBuildName = sceneBuildName;
            OnSceneLoaded = onSceneLoaded;
        }

        public LoadSceneMsg(int sceneBuildIndex, string sceneBuildName, Action onSceneLoaded)
        {
            SceneBuildIndex = sceneBuildIndex;
            SceneBuildName = sceneBuildName;
            OnSceneLoaded = onSceneLoaded;
        }

        public LoadSceneMsg()
        {
            SceneBuildIndex = -1;
            SceneBuildName = null;
            OnSceneLoaded = null;
        }
        
        public void Change(int sceneBuildIndex, string sceneBuildName, Action onSceneLoaded)
        {
            SceneBuildIndex = sceneBuildIndex;
            SceneBuildName = sceneBuildName;
            OnSceneLoaded = onSceneLoaded;
        }
    }
}